package com.create404.suishoupai.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.create404.suishoupai.dto.CommentedPhotoRecordsDto;
import com.create404.suishoupai.dto.PhotoRecordCommentDto;
import com.create404.suishoupai.entity.PhotoRecordComment;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author create404
 * @since 2021-07-17
 */
public interface PhotoRecordCommentMapper extends BaseMapper<PhotoRecordComment> {
    @Select("SELECT photo_record_comment.*, employee.`name`, employee.`avatar` FROM photo_record_comment INNER JOIN employee ON photo_record_comment.employee_id = employee.employee_id AND photo_record_comment.photo_record_id = #{photoRecordId}")
    List<PhotoRecordCommentDto> getPhotoRecordCommentList(String photoRecordId);

    IPage<CommentedPhotoRecordsDto> getCommentedPhotoRecords(Page<?> page, String employeeId);





}
